package routers

import (
	"github.com/gin-gonic/gin"
	swaggerFiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
	"wecom_rebot/common"
)

type RouterGroup struct {
	*gin.RouterGroup
}

func Router() *gin.Engine {
	// 隐藏多余头部信息
	gin.SetMode(common.Config.System.Env)
	r := gin.Default()

	// Swagger 配置
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	settingsGroup := r.Group("")

	routerGroupApp := RouterGroup{settingsGroup}

	// 获取消息接口
	routerGroupApp.InitReceiveRouter()

	return r
}
